package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteOrgConfigService;
import com.ruoyi.system.api.domain.SysConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;


@Component
public class RemoteOrgConfigServiceFallbackFactory implements FallbackFactory<RemoteOrgConfigService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteOrgConfigServiceFallbackFactory.class);

    @Override
    public RemoteOrgConfigService create(Throwable cause) {
        return new RemoteOrgConfigService() {
            @Override
            public R<List<SysConfig>> configList(SysConfig sysConfig, String source) {
                return R.fail("获取机构参数列表失败:");
            }
        };
    }
}
